Repository navigation
feat(workspace): agent-run statement signed by a runner or steward key (DSSE) - #3413
Merged
Merged
Conversation
…y (DSSE) A runner or steward key that .chant/trust.json lists at base signs an in-toto statement over an ended agent run: the run record's hash, its work item, harness, model, provider and principal, and the commits it made with their patch-ids. runs sign stores it as a statement line in the run's ledger file, signing with --key or checking an envelope signed elsewhere (--envelope, with runs statement printing the payload). runs --json and runs verify judge every stored statement against the keys at base; runs verify fails only with --require signed. workspace verify counts a commit a signed run made as attested by the agent-run attestor, and --require attested-runs requires it of every commit a run made. Decision record ws-090.
# Conflicts: # docs/data/boundary.yaml # docs/design/decisions/README.md # docs/src/content/docs/reference/boundary.mdx # docs/src/content/docs/reference/workspace-read-contract.mdx
# Conflicts: # docs/src/content/docs/reference/workspace-read-contract.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An agent run's record is written by whatever ran the agent, so on its own it is only as trustworthy as that writer. This adds the agent-run statement that #2553 handed on: an in-toto Statement v1 in a DSSE envelope, signed by a runner or steward key, that a reader can check offline.
The statement's subjects are the commits the run made, by gitCommit with their patch-id as an annotation. Its predicate (
https://intentius.io/chant/agent-run/v1) holds the signer's principal, the run id and the SHA-256 of the run record (the canonical JSON of its start and end lines), and the work item, harness, model, provider and the principal the run worked for, which is what studio-036 b asks for. The signing key is one.chant/trust.jsonlists at base underrunners, the same keys and refusal rules as runner evidence (ws-069), so a person's key from the signers file is refused. Studio's lobby key goes there with classservice(studio-033 c, studio-034 a).New commands:
chant workspace runs sign <id> --key <pem>builds the statement from the ledger, signs it and appends it to_agent-runs/<id>.jsonlas astatementline after the run's end.chant workspace runs statement <id> --signer <principal>prints the statement and the base64 payload for a signer that keeps its key elsewhere;runs sign <id> --envelope <file|->checks what it returns and stores it.chant workspace runs verify [<id>] [--require signed]judges every stored statement against the runner keys at base. It reports and exits 0 unless--require signedis given (studio-035 d).runs --jsonnow gives each runrecord,statementsandattestation(status signed, unsigned, mismatch, untrusted or invalid, with signer, class, keyid, code and the commits covered), and the document gainstrust(the base and its runner principals).workspace verifycounts a commit a run made asattestedwith the attestoragent-runwhen a verified statement names it, lists the run commits in a newrunspart of the report, and takes--require attested-runs, which requires a statement only for commits a run made and needs no signers file. Statements are re-verified on every read, so removing a runner key at base makes what it signed read as untrusted.New reason codes:
run-not-ended,run-statement-invalid,run-statement-signer-mismatch,run-statement-mismatch; runner evidence's envelope and runner-key codes are reused. New schemarun-statement.schema.json;runs.schema.jsonandruns-write.schema.jsongain fields within v1. Shared files touched:reason-codes.ts,docs/data/boundary.yaml(new rows and carriers) and the generated boundary page, the read-contract page, and the decisions README. Decision record ws-090.Verified with core tsc, the new
runs-statement.test.ts(signing here and elsewhere, every refusal, record mismatch, report-only and required verify,workspace verify --require attested-runs, revocation at base), the runs, reason-code, trust, boundary-roster, read-contract and CLI help tests, the docs checks, and a CLI run against a scratch workspace.Closes #3192